package com.googlecode.connectlet.crypto.cipher.rc5;

import com.googlecode.connectlet.crypto.cipher.CipherFactory;

public class RC532CipherFactory implements CipherFactory {
	private static RC532CipherFactory instance = new RC532CipherFactory();

	public static RC532CipherFactory getInstance() {
		return instance;
	}

	private int rounds;

	private RC532CipherFactory() {
		this(RC532Cipher.DEFAULT_ROUNDS);
	}

	public RC532CipherFactory(int rounds) {
		this.rounds = rounds;
	}

	@Override
	public int getBlockSize() {
		return RC532Cipher.BLOCK_SIZE;
	}

	@Override
	public RC532Cipher getEncipheror(byte[] key) {
		return new RC532Cipher(rounds, key);
	}

	@Override
	public RC532Cipher getDecipheror(byte[] key) {
		return new RC532Cipher(rounds, key);
	}
}